package chapter06.e2;

import java.util.LinkedList;

public class e2 {
    public static void main(String[] args) {
        LinkedList list = new LinkedList();
        list.add("张三");
        list.add("李四");
        list.add("王五");
        list.add("赵六");
        list.add(Math.PI);
        //查看list长度
        System.out.println("集合长度："+list.size());
        System.out.println(list);
        //查看指定位置元素
        System.out.println("第二个元素是："+list.get(1));
        //修改指定元素
        list.set(2,"王小明");
        System.out.println(list);
        list.add(2,"隔壁老王");
        System.out.println(list);
        list.remove(5);
    }
}
